#!/bin/bash

req_packs=\
"\
ConcurrentLogHandler==0.8.4
SQLAlchemy==0.7.1
gunicorn==0.12.2
lxml==2.3
meinheld==0.4.13
netifaces==0.4
numpy==1.6.0
progressbar==2.3
psycopg2==2.4.2
simplejson==1.9.2\
"

num_packs=`echo $req_packs |awk -F== '{print NF}'`
num_packs=$(($num_packs - 1))
echo "-------[$num_packs] packages:-------"

declare -a name_ver_packs=( `echo $req_packs |awk '{print}'` )
for i in $(seq $num_packs)
do
    i=$((i-1))
    name_pack=`echo ${name_ver_packs[i]} |awk -F== '{print $1}'`
    name_ver_pack=`pip freeze |grep "$name_pack"`
    echo $name_ver_pack
done
echo "----------------------------"
